import { request } from '@/utils/http'
/**
 * 用户管理
 */
export default {
    create: data => request.post('/user/add', data), // 新增老师
    delete: id => request.delete(`/user/${id}`), // 删除老师
    batchDelete: data => request.delete('/user/batch', { data }), // 批量删除老师
    edit: (id, data) => request.put(`/user/${id}`, data), // 编辑老师
    list: (params = {}) => request.get('/user/list', { params }), // 获取老师列表
    import: data => request.post('/user/import', data), // 导入老师
    export: (params = {}) => request.get('/user/export', { 
        params,
        responseType: 'blob',  // 设置响应类型为 blob
        timeout: 60000  // 可以设置更长的超时时间
    }),
    resetPwd: id => request.put(`/user/reset/${id}`), // 重置密码

    getInfoById: id => request.get(`/user/${id}`),
    getInfoByToken: () => request.get(`/user/current`),

}
